<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <button>点击</button>
    <button>点击</button>
    <button>点击</button>
    <script>
        // 1.call()
        var o = {
            uname: 'andy',

        };
        fn.call(o);

        function fn() {

        }

        function Father(age) {

            this.age = age;
        }

        function Son(age) {
            Father.call(this, age);
        }
        var son = new Son(12);


        // 2.apply
        var arr = [1, 3, 4, 6, 6, 74, 6456324, 52, 52];
        var max = Math.max.apply(Math, arr);
        console.log(max);

        //3.bind() 
        var btns = document.querySelectorAll('button');
        for (var i = 0; i < btns.length; i++) {
            btns[i].addEventListener('click', function () {
                this.disabled = true;
                setTimeout(function () {
                    this.disabled = false;
                }.bind(this), 3000) //这个this指向的时btn
            })
        }
    </script>
</body>

</html>